package com.teatrace.action.converter;

import java.util.Map;

import org.apache.struts2.util.StrutsTypeConverter;

public class CheckBoxBooleanConverter extends StrutsTypeConverter{

	@Override
	public Object convertFromString(Map arg0, String[] params, Class arg2) {
		System.out.println("--------------------类型转换器----------------------------");
		if(params == null) return null;
		if(params.length > 1) return params;
		String param = params[0];
		if(param.equals("on")) {
			return true;
		}
		return false;
	}

	@Override
	public String convertToString(Map arg0, Object arg1) {

		return null;
	}

}
